<?php
	global $_W,$_GPC;		
	if($_W['role']){
		$card_on='';
		$card_on = $_GPC['card_on'];
		if(!empty($card_on)){
			$sql =  "SELECT uc.id,uc.card_on,uc.card_type,uc.use,uc.addtime,c.title,c.starttime,c.endtime,c.condition,c.minus,c.discount,u.uName,u.uPhone FROM ".tablename('mii_ang_ucard')." uc LEFT JOIN ".tablename('mii_ang_card')." c ON uc.cid=c.id LEFT JOIN ".tablename('mii_ang_user')." u ON uc.uid=u.uid WHERE uc.uniacid=:uniacid AND uc.card_on=:card_on ";
			$o = pdo_fetch($sql,array(':uniacid'=>$_W['uniacid'],':card_on'=>$card_on));
		}
		if(empty($o)&&empty($card_on)){
			$i = 'nosearch';
		}elseif(empty($o)&&!empty($card_on)){
			$i = 'empty';
		}else{
			$i = '';
		}		
		include	$this->template('web/card/cardoff');

	}else{
		message('没有操作权限');
	}
	function cardname($type){
		if ($type == 'DISCOUNT') {
			$name = '折扣券';
		} elseif ($type == 'CASH') {
			$name = '代金券';
		} elseif ($type == 'GENERAL_COUPON') {
			$name = '优惠券';
		} elseif ($type == 'GIFT') {
			$name = '礼品券';
		} elseif ($type == 'GROUPON') {
			$name = '团购券';
		}elseif($type=='MEMBER_CARD'){
			$name = '会员卡';
		}
		return $name;
	}
?>